import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
// tslint:disable-next-line:ordered-imports
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import format from '@dfeidao/atom-web/dt/format';
import show from '@dfeidao/atom-web/ui/show';
import p001 from './p001';
export default async function a001(fd: IFeidaoAiBrowserComponent,datadel: string) {
	// todo
	const look=fd.data.node.querySelector<HTMLDivElement>('[data-id="look"]');
	set_node_cls(look,'display-n',false);
	show(fd.data.node);
	const res = await nodejs<{dt: Array<{ departure_date: number}>,dp: Array<{}>}>('staff-management/zj-000004/s001',{filter:{staff_no:datadel}});
	const departure= format(res.dt[0].departure_date,0);
    const a = res.dt.map((item) => {
		return{...item,departure};
	});
	const render_data=Object.assign({},{res:a},{ret:res.dp});
	render(fd,render_data,p001,'p001','inner');



}
